Patrick Irving, 5/19/2021
To enable fast and easy exploration of MaP experimental data.
Jupyter Notebooks come installed with Anaconda, and are accessible on Longleaf through OpenOnDemand.
plotmapper.py can be found in the JNBTools repo on Github.
Plotmapper.py includes a variety of tools for plotting:
I'm happy to help with this. Instructions are on the GitHub page.
The first code cell of a notebook should define defaults and load in modules
For high-level plotting functions, you only need to import plotmapper.
For this demonstration, I also need matplotlib.pyplot.
# Display plots in-line
%matplotlib inline
# import modules
import plotmapper as MaP
import matplotlib.pyplot as plt
MaP.Sample is the core object in this package. For each MaP experimental sample, it holds the following information.
example1 = MaP.Sample(sample="example1",
profile = 'data/example1_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example1-rnasep.corrs',
pairs = 'data/example1-rnasep-pairmap.txt',
log = 'data/example1_shapemapper_log.txt',
dance_prefix = 'data/example1_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb')
example2 = MaP.Sample(sample="example2",
profile = 'data/example2_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example2-rnasep.corrs',
pairs = 'data/example2-rnasep-pairmap.txt',
log = 'data/example2_shapemapper_log.txt',
dance_prefix = 'data/example2_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb')
example3 = MaP.Sample(sample="example3",
profile = 'data/example3_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example3-rnasep.corrs',
pairs = 'data/example3-rnasep-pairmap.txt',
log = 'data/example3_shapemapper_log.txt',
dance_prefix = 'data/example3_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb')
example4 = MaP.Sample(sample="example4",
profile = 'data/example4_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example4-rnasep.corrs',
pairs = 'data/example4-rnasep-pairmap.txt',
log = 'data/example4_shapemapper_log.txt',
dance_prefix = 'data/example4_rnasep',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb')
example2.make_log_qc();
MaP.array_qc([example1, example2, example3, example4]);
fig, ax = plt.subplots(1,2, figsize=(14,7))
example2.make_regression(example1, ax=ax[0])
example4.make_regression(example3, ax=ax[1], colorby="nucleotide")
example2.plot_sm_profile();
example2.plot_sm_rates();
example2.plot_sm_depth();
example2.make_shapemapper();
example2.make_skyline();
MaP.array_skyline([example1, example2, example3, example4]);
example2.make_dance_skyline();
The plots I'll be showing don't have colorbars yet. To get a stand-alone colorbar, use the view_colormap() function:
MaP.view_colormap("pairs")
MaP.view_colormap("rings")
MaP.view_colormap("deletions")
MaP.view_colormap("deletions", metric="Distance")
fig, ax = plt.subplots(1, 2, figsize=(14, 7))
example2.make_heatmap("deletions", "pdb", ax=ax[0])
example2.make_heatmap("deletions", "ct", ax=ax[1]);
example2.make_ap(ij_data="deletions", Percentile=0.95);
MaP.array_ap([example1, example2, example3, example4], ij_data="rings", cdAbove=15);
example2.make_ss(ij_data="rings");
MaP.array_ss([example1, example2, example3, example4], ij_data="pairs");
Controls:
example2.make_3d(ij_data="deletions", metric="Distance", Percentile=0.99)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x200c0bd2a08>
MaP.array_3d([example1, example2, example3, example4], ij_data="rings", Statistic=15)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x200c0c47408>
PlotMapper and Jupyter Notebooks provides a fast and easy way to explore MaP and JuMP data sets.
example2.print_new_ij_file("rings", cdAbove=30, cdBelow=80, Statistic=30, Mod_Comuts=300, ss_only=True, profAbove=0.5, profBelow=2)
325 Window=1 Metric=APC i j Statistic +/- Zij Zi Zj Mod_Depth Mod_Comuts Unt_Depth Unt_Comuts 85 158 74.47 1 4.21 3.41 5.02 290595 422 321178 5 89 156 48.02 1 4.32 5.34 3.31 294128 446 322918 1 89 158 39.7 1 3.53 4.4 2.65 295731 856 322888 3 98 158 37.13 1 2.01 1.54 2.47 298273 755 325757 4